package com.netty.demo.nio.handler.impl;

import com.netty.demo.protocol.packet.MessagePacket;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

public class ServerMessageReceiveHandler extends SimpleChannelInboundHandler<MessagePacket> {
    @Override
    protected void channelRead0(ChannelHandlerContext channelHandlerContext, MessagePacket messagePacket) throws Exception{
        System.out.println("收到用户（" + messagePacket.getUserId() + "）于（" + messagePacket.getSendTime() + "）发送的消息：" + messagePacket.getMessage());
        System.out.println("输入消息发送至客户端: ");
    }
}
